#ifndef AirQuality_h
#define AirQuality_h

#include "Arduino.h"

class AirQuality {
  public:
    AirQuality(HardwareSerial& serial);
    void begin(unsigned long baud, uint8_t config = SERIAL_8N1, int8_t rxPin = -1, int8_t txPin = -1);
    bool readAllData();
    unsigned int getCO2();
    unsigned int getCH2O();
    unsigned int getTVOC();
    unsigned int getPM25();
    unsigned int getPM10();
    float getTemperature();
    float getHumidity();

    const char* getCO2Unit();
    const char* getCH2OUnit();
    const char* getTVOCUnit();
    const char* getPM25Unit();
    const char* getPM10Unit();
    const char* getTemperatureUnit();
    const char* getHumidityUnit();

  private:
    HardwareSerial& _serial;
    unsigned int _co2Value;
    unsigned int _ch2oValue;
    unsigned int _tvocValue;
    unsigned int _pm25Value;
    unsigned int _pm10Value;
    float _temperature;
    float _humidity;
};

#endif